package com.supersit.GZFDA.util;

import java.net.URLDecoder;
import java.net.URLEncoder;

import android.util.Log;

public class ToURLEncode {
	public static String toURLEncoded(String paramString) {
		if (paramString == null || paramString.equals("")) {
			Log.d("tag", "toURLEncoded error:" + paramString);
			return "";
		}

		try {
			String str = new String(paramString.getBytes(), "UTF-8");
			str = URLEncoder.encode(str, "UTF-8");
			return str;
		} catch (Exception localException) {
			Log.e("tag", "toURLEncoded error:" + paramString, localException);
		}

		return "";
	}

	public static String toURLDecoded(String paramString) {
		if (paramString == null || paramString.equals("")) {
			Log.d("tag", "toURLDecoded error:" + paramString);
			return "";
		}
		try {
			String str = new String(paramString.getBytes(), "UTF-8");
			str = URLDecoder.decode(str, "UTF-8");
			return str;
		} catch (Exception localException) {
			Log.e("tag", "toURLEncoded error:" + paramString, localException);
		}

		return "";
	}
}
